/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('hologram', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangeResourceGroupRequest {
  instanceId?: string(name='instanceId', description='The instance ID.', example='hgprecn-cn-zvp25ysv3006'),
  newResourceGroupId?: string(name='newResourceGroupId', description='new resource group id', example='rg-acfmxwerqwerasfd'),
}

model ChangeResourceGroupResponseBody = {
  data?: boolean(name='Data', description='The returned data.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='AB71198A-2DB1-511B-AE4D-690BAA97F076'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Updates a resource group.
 *
 * @param request ChangeResourceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.newResourceGroupId)) {
    body['newResourceGroupId'] = request.newResourceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/tag/changeResourceGroup`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a resource group.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return changeResourceGroupWithOptions(request, headers, runtime);
}

model CreateHoloWarehouseRequest {
  cpu?: string(name='cpu', description='The specifications of the virtual warehouse. The number of vCPUs must be an integer multiple of 16 CPUs. Minimum value: 16.

This parameter is required.', example='32'),
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model CreateHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model CreateHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Creates a virtual warehouse.
 *
 * @param request CreateHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHoloWarehouseResponse
 */
async function createHoloWarehouseWithOptions(instanceId: string, request: CreateHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpu)) {
    body['cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/createHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a virtual warehouse.
 *
 * @param request CreateHoloWarehouseRequest
 * @return CreateHoloWarehouseResponse
 */
async function createHoloWarehouse(instanceId: string, request: CreateHoloWarehouseRequest): CreateHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model CreateInstanceRequest {
  autoPay?: boolean(name='autoPay', description='Specifies whether to enable auto-payment. Default value: true. Valid values:

*   true
*   false

>  The default value is true. If the balance of your account is insufficient, you can set this parameter to false. In this case, an unpaid order is generated. You can log on to the Expenses and Costs console to pay for the order.', example='true'),
  autoRenew?: boolean(name='autoRenew', description='Specifies whether to enable monthly auto-renewal. The default value is false. Valid values:

*   true
*   false', example='false'),
  chargeType?: string(name='chargeType', description='The billing method of the instance. Valid values:

*   PrePaid: subscription
*   PostPaid: pay-as-you-go

>  This parameter is invalid for Hologres Shared Cluster instances. Hologres Shared Cluster instances have fixed specifications and are pay-as-you-go instances.

This parameter is required.', example='PostPaid'),
  coldStorageSize?: long(name='coldStorageSize', description='The infrequent access (IA) storage space of the instance. Unit: GB.

>  This parameter is invalid for pay-as-you-go instances.', example='500'),
  cpu?: long(name='cpu', description='The instance specifications. Valid values:

*   8-core 32GB (number of compute nodes: 1)
*   32-core 128GB (number of compute nodes: 2)
*   64-core 256GB (number of compute nodes: 4)
*   96-core 384GB (number of compute nodes: 6)
*   128-core 512GB (number of compute nodes: 8)
*   Others

> 

*   Set this parameter to the number of cores.

*   If you want to set this parameter to specifications with more than 1,024 GB, you must submit a ticket.

*   This parameter is invalid for Hologres Shared Cluster instances.

*   The specifications of 8-core 32GB (number of compute nodes: 1) are for trial use only and cannot be used for production.', example='64'),
  duration?: long(name='duration', description='The validity period of the instance that you want to purchase. For example, you can specify a validity period of two months.

>  You do not need to configure this parameter for pay-as-you-go instances.', example='2'),
  enableServerlessComputing?: boolean(name='enableServerlessComputing', description='Specifies whether to enable the Serverless Computing feature.

Valid values:

*   true
*   false', example='true'),
  gatewayCount?: long(name='gatewayCount', description='The number of gateways. Valid values: 2 to 50.

>  This parameter is required only for virtual warehouse instances.', example='4'),
  initialDatabases?: string(name='initialDatabases', description='The initial database.', example='chatbot'),
  instanceName?: string(name='instanceName', description='The name of the instance. The name must be 2 to 64 characters in length.

This parameter is required.', example='my_holo'),
  instanceType?: string(name='instanceType', description='The category of the instance. Valid values:

*   Standard: general-purpose instance
*   Follower: read-only secondary instance
*   Warehouse: virtual warehouse instance
*   Shared: Hologres Shared Cluster instance

This parameter is required.', example='Standard'),
  leaderInstanceId?: string(name='leaderInstanceId', description='The ID of the primary instance. This parameter is required for read-only secondary instances.

>  The primary and secondary instances must meet the following requirements:

*   The primary instance is in the Running state.

*   The primary instance and secondary instances are deployed in the same region.

*   The primary instance and secondary instances are deployed in the same zone.

*   Less than 10 secondary instances are associated with the primary instance.

*   The primary instance and secondary instances belong to the same Alibaba Cloud account.', example='hgpostcn-cn-lbj3aworq112'),
  pricingCycle?: string(name='pricingCycle', description='The billing cycle. Valid values:

*   Month
*   Hour

> 

*   This parameter can only be set to Month for subscription instances.

*   This parameter can only be set to Hour for pay-as-you-go instances.

*   By default, this parameter is set to Hour for Hologres Shared Cluster instances.', example='Month'),
  regionId?: string(name='regionId', description='The ID of the region. You can obtain region IDs in [Endpoints](https://www.alibabacloud.com/help/en/maxcompute/user-guide/endpoints).

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='resourceGroupId', description='The ID of the resource group. If you do not specify this parameter, the default resource group of the account is used.', example='""'),
  storageSize?: long(name='storageSize', description='The standard storage space of the instance. Unit: GB.

>  This parameter is invalid for pay-as-you-go instances.', example='500'),
  storageType?: string(name='storageType'),
  vSwitchId?: string(name='vSwitchId', description='The ID of the vSwitch. The zone in which the vSwitch resides must be the same as the zone in which the Hologres instance resides.

This parameter is required.', example='vsw-2vccsiymtxxxxxx'),
  vpcId?: string(name='vpcId', description='The ID of the virtual private cloud (VPC). The region in which the VPC resides must be the same as the region in which the Hologres instance resides.

This parameter is required.', example='vpc-t4netc3y5xxxx'),
  zoneId?: string(name='zoneId', description='The ID of the zone. For more information, see the "Operation description" section in this topic.

This parameter is required.', example='cn-hangzhou-h'),
}

model CreateInstanceResponseBody = {
  data?: {
    code?: string(name='Code', description='The error code returned.', example='InvalidVpcOrVSwitch.NotAvailable'),
    instanceId?: string(name='InstanceId', description='The instance ID.', example='hgpostcn-cn-xxxxxx'),
    message?: string(name='Message', description='The error details.', example='Vpc is not available'),
    orderId?: string(name='OrderId', description='The order ID.', example='217523224780172'),
    success?: string(name='Success', description='Indicates whether the instance was created.

*   true
*   false', example='true'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code returned.', example='null'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='null'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9CC37B9F-F4B4-5FF1-939B-AEE78DC70130'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @summary Creates a Hologres instance.
 *
 * @description > Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing details of Hologres, see [Pricing](https://www.alibabacloud.com/help/en/hologres/developer-reference/api-hologram-2022-06-01-createinstance).
 * *   When you purchase a Hologres instance, you must specify the region and zone in which the Hologres instance resides. A region may correspond to multiple zones. Example:
 * <!---->
 *     cn-hangzhou: cn-hangzhou-h, cn-hangzhou-j
 *        cn-shanghai: cn-shanghai-e, cn-shanghai-f
 *        cn-beijing: cn-beijing-i, cn-beijing-g
 *        cn-zhangjiakou: cn-zhangjiakou-b
 *        cn-shenzhen: cn-shenzhen-e
 *        cn-hongkong: cn-hongkong-b
 *        cn-shanghai-finance-1: cn-shanghai-finance-1z
 *        ap-northeast-1: ap-northeast-1a
 *        ap-southeast-1: ap-southeast-1c
 *        ap-southeast-3: ap-southeast-3b
 *        ap-southeast-5: ap-southeast-5b
 *        ap-south-1: ap-south-1b
 *        eu-central-1: eu-central-1a
 *        us-east-1: us-east-1a
 *        us-west-1: us-west-1b
 *
 * @param request CreateInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.autoPay)) {
    body['autoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    body['autoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.chargeType)) {
    body['chargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.coldStorageSize)) {
    body['coldStorageSize'] = request.coldStorageSize;
  }
  if (!Util.isUnset(request.cpu)) {
    body['cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.duration)) {
    body['duration'] = request.duration;
  }
  if (!Util.isUnset(request.enableServerlessComputing)) {
    body['enableServerlessComputing'] = request.enableServerlessComputing;
  }
  if (!Util.isUnset(request.gatewayCount)) {
    body['gatewayCount'] = request.gatewayCount;
  }
  if (!Util.isUnset(request.initialDatabases)) {
    body['initialDatabases'] = request.initialDatabases;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['instanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.leaderInstanceId)) {
    body['leaderInstanceId'] = request.leaderInstanceId;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    body['pricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.regionId)) {
    body['regionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['resourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.storageSize)) {
    body['storageSize'] = request.storageSize;
  }
  if (!Util.isUnset(request.storageType)) {
    body['storageType'] = request.storageType;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    body['vSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['vpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    body['zoneId'] = request.zoneId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a Hologres instance.
 *
 * @description > Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing details of Hologres, see [Pricing](https://www.alibabacloud.com/help/en/hologres/developer-reference/api-hologram-2022-06-01-createinstance).
 * *   When you purchase a Hologres instance, you must specify the region and zone in which the Hologres instance resides. A region may correspond to multiple zones. Example:
 * <!---->
 *     cn-hangzhou: cn-hangzhou-h, cn-hangzhou-j
 *        cn-shanghai: cn-shanghai-e, cn-shanghai-f
 *        cn-beijing: cn-beijing-i, cn-beijing-g
 *        cn-zhangjiakou: cn-zhangjiakou-b
 *        cn-shenzhen: cn-shenzhen-e
 *        cn-hongkong: cn-hongkong-b
 *        cn-shanghai-finance-1: cn-shanghai-finance-1z
 *        ap-northeast-1: ap-northeast-1a
 *        ap-southeast-1: ap-southeast-1c
 *        ap-southeast-3: ap-southeast-3b
 *        ap-southeast-5: ap-southeast-5b
 *        ap-south-1: ap-south-1b
 *        eu-central-1: eu-central-1a
 *        us-east-1: us-east-1a
 *        us-west-1: us-west-1b
 *
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createInstanceWithOptions(request, headers, runtime);
}

model DeleteHoloWarehouseRequest {
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model DeleteHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model DeleteHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Deletes a virtual warehouse.
 *
 * @param request DeleteHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHoloWarehouseResponse
 */
async function deleteHoloWarehouseWithOptions(instanceId: string, request: DeleteHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/deleteHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a virtual warehouse.
 *
 * @param request DeleteHoloWarehouseRequest
 * @return DeleteHoloWarehouseResponse
 */
async function deleteHoloWarehouse(instanceId: string, request: DeleteHoloWarehouseRequest): DeleteHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model DeleteInstanceRequest {
  regionId?: string(name='RegionId', description='The ID of the region in which the Hologres instance resides.', example='cn-hangzhou'),
}

model DeleteInstanceResponseBody = {
  data?: boolean(name='Data', description='The returned result, which indicates whether the request was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code returned.', example='null'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='null'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status Code', example='200'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB13FFDD-2DF8-5396-A848-2D6A31245B6D'),
  success?: boolean(name='Success', description='Indicates whether the call was successful.', example='true'),
}

model DeleteInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstanceResponseBody(name='body'),
}

/**
 * @summary Deletes a Hologres instance.
 *
 * @description > Before you call this operation, read the documentation and make sure that you understand the prerequisites and impacts of this operation.
 * *   After you delete a Hologres instance, data and objects in the instance cannot be restored. Proceed with caution. For more information, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview?spm=a2c63.p38356.0.0.efc33b87i5pDl7).
 * *   You can delete only pay-as-you-go instances.
 *
 * @param request DeleteInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstanceResponse
 */
async function deleteInstanceWithOptions(instanceId: string, request: DeleteInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a Hologres instance.
 *
 * @description > Before you call this operation, read the documentation and make sure that you understand the prerequisites and impacts of this operation.
 * *   After you delete a Hologres instance, data and objects in the instance cannot be restored. Proceed with caution. For more information, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview?spm=a2c63.p38356.0.0.efc33b87i5pDl7).
 * *   You can delete only pay-as-you-go instances.
 *
 * @param request DeleteInstanceRequest
 * @return DeleteInstanceResponse
 */
async function deleteInstance(instanceId: string, request: DeleteInstanceRequest): DeleteInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteInstanceWithOptions(instanceId, request, headers, runtime);
}

model DisableHiveAccessRequest {
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
}

model DisableHiveAccessResponseBody = {
  data?: boolean(name='Data', description='The returned result.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='82B7A554-4D00-50DF-95D9-B59E7B4D5489'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
}

model DisableHiveAccessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableHiveAccessResponseBody(name='body'),
}

/**
 * @summary Disables data lake acceleration.
 *
 * @param request DisableHiveAccessRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableHiveAccessResponse
 */
async function disableHiveAccessWithOptions(instanceId: string, request: DisableHiveAccessRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableHiveAccessResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableHiveAccess',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/disableHiveAccess`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables data lake acceleration.
 *
 * @param request DisableHiveAccessRequest
 * @return DisableHiveAccessResponse
 */
async function disableHiveAccess(instanceId: string, request: DisableHiveAccessRequest): DisableHiveAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableHiveAccessWithOptions(instanceId, request, headers, runtime);
}

model EnableHiveAccessRequest {
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model EnableHiveAccessResponseBody = {
  data?: boolean(name='Data', description='The returned data.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='EA8F0084-5831-5907-BB31-BD05D2617844'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model EnableHiveAccessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableHiveAccessResponseBody(name='body'),
}

/**
 * @summary Enables data lake acceleration.
 *
 * @param request EnableHiveAccessRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableHiveAccessResponse
 */
async function enableHiveAccessWithOptions(instanceId: string, request: EnableHiveAccessRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableHiveAccessResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableHiveAccess',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/enableHiveAccess`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables data lake acceleration.
 *
 * @param request EnableHiveAccessRequest
 * @return EnableHiveAccessResponse
 */
async function enableHiveAccess(instanceId: string, request: EnableHiveAccessRequest): EnableHiveAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableHiveAccessWithOptions(instanceId, request, headers, runtime);
}

model GetInstanceResponseBody = {
  errorCode?: string(name='ErrorCode', description='The error code that is returned if the request failed.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code returned.', example='200'),
  instance?: {
    autoRenewal?: string(name='AutoRenewal', description='Indicates whether auto-renewal is enabled.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
    coldStorage?: long(name='ColdStorage', description='The cold storage capacity of the instance. Unit: GB. Standard SSD is used for hot storage, and HDD is used for cold storage.', example='800'),
    commodityCode?: string(name='CommodityCode', description='The commodity code.

Valid values:

*   hologram_maxcomputeAccelerate_public_cn

    <!-- -->

    :

    <!-- -->

    China site/Lakehouse Acceleration Edition

    <!-- -->

    .

*   hologram_combo_public_cn

    <!-- -->

    :

    <!-- -->

    China site/Subscription

    <!-- -->

    .

*   hologram_prepay_public_intl

    <!-- -->

    :

    <!-- -->

    International site/Subscription

    <!-- -->

    .

*   hologram_storage_dp_cn

    <!-- -->

    :

    <!-- -->

    China site/Storage plan

    <!-- -->

    .

*   hologram_postpay_public_cn

    <!-- -->

    :

    <!-- -->

    China site/Pay-as-you-go

    <!-- -->

    .

*   hologram_postpay_public_intl

    <!-- -->

    :

    <!-- -->

    International site/Pay-as-you-go

    <!-- -->

*   hologram_maxcomputeAccelerate_public_intl

    <!-- -->

    :

    <!-- -->

    International site/Lakehouse Acceleration Edition

    <!-- -->

    .

*   hologram_cu_dp_cn

    <!-- -->

    :

    <!-- -->

    China site/Compute plan

    <!-- -->', example='hologram_combo_public_cn'),
    computeNodeCount?: long(name='ComputeNodeCount', description='The number of compute nodes. In a typical configuration, a node has 16 CPU cores and 32 GB of memory.', example='2'),
    cpu?: long(name='Cpu', description='The number of CPU cores.', example='32'),
    creationTime?: string(name='CreationTime', description='The time when the instance was created.', example='2021-02-03T13:06:06Z'),
    disk?: string(name='Disk', description='The amount of data that can be stored in the disk of the Standard storage class. Unit: GB.', example='500'),
    enableHiveAccess?: string(name='EnableHiveAccess', description='Indicates whether data lake acceleration is enabled.', example='true'),
    enableServerless?: boolean(name='EnableServerless', description='EnableServerless', example='true'),
    endpoints?: [ 
      {
        alternativeEndpoints?: string(name='AlternativeEndpoints', description='The endpoint. This parameter is returned if both the AnyTunnel and SingleTunnel modes are enabled for an instance, and the instance is switched from the AnyTunnel mode to the SingleTunnel mode. In this case, two endpoints are returned.', example='hgprecn-cn-uqm362o1b001-cn-hangzhou-internal.hologres.aliyuncs.com:80'),
        enabled?: boolean(name='Enabled', description='Indicates whether the network is enabled.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
        endpoint?: string(name='Endpoint', description='The endpoint.', example='hgprecn-cn-uqm362o1b001-cn-hangzhou-internal.hologres.aliyuncs.com:80'),
        type?: string(name='Type', description='The network type.

Valid values:

*   VPCSingleTunnel

    <!-- -->

    :

    <!-- -->

    virtual private cloud (VPC)

    <!-- -->

    .

*   Intranet

    <!-- -->

    :

    <!-- -->

    internal network

    <!-- -->

    .

*   VPCAnyTunnel

    <!-- -->

    :

    <!-- -->

    not supported by new instances

    <!-- -->

*   Internet

    <!-- -->

    :

    <!-- -->

    Internet

    <!-- -->

    .', example='Internet'),
        vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1jqwp2ys6kp7tc9t983'),
        vpcId?: string(name='VpcId', description='The ID of the VPC to which the instance belongs.', example='vpc-uf66jjber3hgvwhki3wna'),
        vpcInstanceId?: string(name='VpcInstanceId', description='The ID of the instance that is deployed in the VPC.', example='hgprecn-cn-uqm362o1b001-frontend-st'),
      }
    ](name='Endpoints', description='The list of endpoints.'),
    expirationTime?: string(name='ExpirationTime', description='The expiration time. This parameter is invalid for pay-as-you-go instances.', example='2021-02-03T13:06:06Z'),
    gatewayCount?: long(name='GatewayCount', description='The number of gateway nodes.', example='2'),
    gatewayCpu?: long(name='GatewayCpu', description='The number of CPU cores of the gateway. Unit: core.', example='4'),
    gatewayMemory?: long(name='GatewayMemory', description='The size of memory resources of the gateway. Unit: GB.', example='16'),
    instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the instance.

Valid values:

*   PostPaid

    <!-- -->

    :

    <!-- -->

    pay-as-you-go

    <!-- -->

    .

*   PrePaid

    <!-- -->

    :

    <!-- -->

    subscription

    <!-- -->

    .', example='PrePaid'),
    instanceId?: string(name='InstanceId', description='The instance ID.', example='hgpostcn-cn-tl32s6cgw00b'),
    instanceName?: string(name='InstanceName', description='The instance name. The instance name must be 2 to 64 characters in length.', example='test'),
    instanceOwner?: string(name='InstanceOwner', description='The owner of the instance.', example='12345678900000'),
    instanceStatus?: string(name='InstanceStatus', description='The status of the instance.

Valid values:

*   Creating

    <!-- -->

    <!-- -->

    <!-- -->

*   Running

    <!-- -->

    <!-- -->

    <!-- -->

*   Suspended

    <!-- -->

    <!-- -->

    <!-- -->

*   Allocating

    <!-- -->

    <!-- -->

    <!-- -->', example='Running'),
    instanceType?: string(name='InstanceType', description='The type of the instance.

Valid values:

*   Follower

    <!-- -->

    :

    <!-- -->

    read-only secondary instance

    <!-- -->

    .

*   Standard

    <!-- -->

    :

    <!-- -->

    normal instance

    <!-- -->

    .', example='Standard'),
    leaderInstanceId?: string(name='LeaderInstanceId', description='The ID of the primary instance.', example='hgpostcn-cn-i7m2ncd6w002'),
    memory?: long(name='Memory', description='The memory size. Unit: GB.', example='128'),
    regionId?: string(name='RegionId', description='The ID of the region in which the instance resides.', example='cn-hangzhou'),
    replicaRole?: string(name='ReplicaRole', description='Disaster recovery instance role. 
* Active: Primary disaster recovery instance.
* Passive: Disaster tolerance instance.
* PreActive: Primary disaster recovery instance not yet in final state.', example='Active'),
    resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzuq7hpybze2i'),
    storageType?: string(name='StorageType', description='The storage type.

*   redundant: 3 copies
*   local: single copy', example='redundant'),
    suspendReason?: string(name='SuspendReason', description='The reason for the suspension.

Valid values:

*   Indebet

    <!-- -->

    :

    <!-- -->

    The instance has an overdue payment

    <!-- -->

    .

*   Manual

    <!-- -->

    :

    <!-- -->

    The instance is manually suspended

    <!-- -->

    .

*   Overdue

    <!-- -->

    :

    <!-- -->

    The instance has expired

    <!-- -->

    .', example='Manual'),
    tags?: [ 
      {
        key?: string(name='Key', description='The key of tag N.', example='tag'),
        value?: string(name='Value', description='The value of tag N.', example='value'),
      }
    ](name='Tags', description='The instance tag.'),
    version?: string(name='Version', description='The instance version.', example='r1.3.37'),
    zoneId?: string(name='ZoneId', description='The ID of the zone where the instance resides.', example='cn-hangzhou-h'),
  }(name='Instance', description='The information about the instance.'),
  requestId?: string(name='RequestId', description='The request ID.', example='865A02C2-B374-5DD4-9B34-0CA15DA1AEBD'),
  success?: boolean(name='Success', description='The request result, which indicates whether the request was successful.', example='true'),
}

model GetInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResponseBody(name='body'),
}

/**
 * @summary Obtains the details of an instance.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResponse
 */
async function getInstanceWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Obtains the details of an instance.
 *
 * @return GetInstanceResponse
 */
async function getInstance(instanceId: string): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceWithOptions(instanceId, headers, runtime);
}

model GetWarehouseDetailResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D3AE84AB-0873-5FC7-A4C4-8CF869D2FA70'),
  warehouseDetail?: {
    remainingCpu?: string(name='RemainingCpu', description='The remaining unallocated computing resources of the virtual warehouse instance.', example='32'),
    reservedCpu?: string(name='ReservedCpu', description='The reserved computing resources. The amount of computing resources in all running virtual warehouses in an instance cannot exceed the amount of reserved computing resources in the virtual warehouses.', example='64'),
    timedElasticCpu?: string(name='TimedElasticCpu'),
    warehouseList?: [ 
      {
        cpu?: long(name='Cpu', description='The number of CPU cores.', example='32'),
        defaultWarehouse?: boolean(name='DefaultWarehouse'),
        elasticCpu?: long(name='ElasticCpu'),
        id?: long(name='Id', description='The ID.', example='2'),
        mem?: long(name='Mem', description='The memory capacity.', example='128'),
        name?: string(name='Name', description='The name of the virtual warehouse instance.', example='MyWarehouse'),
        nodeCount?: long(name='NodeCount', description='The number of compute nodes.', example='2'),
        rebalanceStatus?: string(name='RebalanceStatus'),
        status?: string(name='Status', description='The status.

Valid values:

*   kRunning

    <!-- -->

    <!-- -->

    <!-- -->

*   kSuspended

    <!-- -->

    <!-- -->

    <!-- -->

*   kInit

    <!-- -->

    <!-- -->

    <!-- -->

*   kFailed

    <!-- -->

    <!-- -->

    <!-- -->

*   kAllocating

    <!-- -->

    <!-- -->

    <!-- -->', example='kRunning'),
      }
    ](name='WarehouseList', description='The list of virtual warehouses.'),
  }(name='WarehouseDetail', description='The returned values.'),
}

model GetWarehouseDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWarehouseDetailResponseBody(name='body'),
}

/**
 * @summary Queries details of a virtual warehouse instance.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWarehouseDetailResponse
 */
async function getWarehouseDetailWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetWarehouseDetailResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWarehouseDetail',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/getWarehouseDetail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries details of a virtual warehouse instance.
 *
 * @return GetWarehouseDetailResponse
 */
async function getWarehouseDetail(instanceId: string): GetWarehouseDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWarehouseDetailWithOptions(instanceId, headers, runtime);
}

model ListBackupDataRequest {
  backupType?: string(name='backupType', description='The backup type. Specific backup data is filtered based on the type. If you leave this parameter empty, all backup data is returned.

Valid values:

*   redundant_remote
*   remote
*   redundant
*   full_remote
*   local
*   full', example='redundant'),
  instanceId?: string(name='instanceId', description='The instance ID.', example='hgprecn-cn-wwoxxxxx'),
}

model ListBackupDataResponseBody = {
  backupDataList?: [ 
    {
      backupType?: string(name='BackupType', description='The backup type. In general, the following two types are supported: local backup and remote backup. In the local backup type, snapshots reside in the same region as your instance. The following two sub-types are available: full (single backup, single replica) and redundant (zone-redundant storage, multiple replicas). In the remote backup type, snapshots and your instance reside in different regions. Remote backups are the replicas of the backups of the full or redundant type in another region. The values local and remote do not represent specific types, but are used only for data filtering. The value local indicates all local backups, and the value remote indicates all remote backups.', example='redundant'),
      coldDataSize?: long(name='ColdDataSize', description='The size of cold data. Unit: bytes.', example='32413521'),
      dataDesc?: string(name='DataDesc', description='The description of the backup data.', example='demo'),
      dataGran?: string(name='DataGran', description='The backup granularity.

Valid values:

*   instance', example='instance'),
      dataSize?: long(name='DataSize', description='The size of the backup data. Unit: bytes.', example='76085723136'),
      dataTime?: string(name='DataTime', description='The snapshot time. The value format of this parameter follows the same standard as that of the StartTime parameter.', example='2024-10-28T12:23:37.000+00:00'),
      endTime?: string(name='EndTime', description='The end time of the backup task. The value format of this parameter follows the same standard as that of the StartTime parameter.', example='2024-10-28T12:27:34.000+00:00'),
      id?: long(name='Id', description='The unique ID of the backup.', example='1780805690994479105'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='hgpostcn-cn-pe33jdxxxxx'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='my-hologres-dw'),
      instanceRegion?: string(name='InstanceRegion', description='The region in which the instance resides.', example='cn-hangzhou'),
      instanceType?: string(name='InstanceType', description='The type of the instance.

Valid values:

*   Warehouse: virtual warehouse instance
*   Standard: general-purpose instance', example='Warehouse'),
      instanceZoneId?: string(name='InstanceZoneId', description='The zone in which the instance resides.', example='cn-hangzhou-j'),
      snapshotRegion?: string(name='SnapshotRegion', description='The region in which the backup data resides.', example='cn-hangzhou'),
      snapshotZoneId?: string(name='SnapshotZoneId', description='The zone in which the backup data resides. In zone-redundant storage mode, backup data is stored in different zones, including the current zone.', example='cn-hangzhou-j'),
      startTime?: string(name='StartTime', description='The start time of the backup task. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ss.SSSTZ format. The time is displayed in UTC (the same below).', example='2024-10-28T11:19:56.000+00:00'),
      status?: string(name='Status', description='The status of the backup task.

Valid values:

*   processing
*   completed
*   failed', example='completed'),
      triggerType?: string(name='TriggerType', description='The mode in which the backup task is triggered.

Valid values:

*   scheduled: periodic backup
*   manual: manual backup', example='scheduled'),
    }
  ](name='BackupDataList', description='The backups.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4AA0C48F-B5BB-5FF9-A43B-6B91E0715D46'),
}

model ListBackupDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBackupDataResponseBody(name='body'),
}

/**
 * @summary Queries a list of backups. A backup is a full data snapshot of an instance at the end of the snapshot time. You can purchase another instance to completely restore the original data.
 *
 * @param request ListBackupDataRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBackupDataResponse
 */
async function listBackupDataWithOptions(request: ListBackupDataRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListBackupDataResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.backupType)) {
    query['backupType'] = request.backupType;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['instanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBackupData',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/backups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of backups. A backup is a full data snapshot of an instance at the end of the snapshot time. You can purchase another instance to completely restore the original data.
 *
 * @param request ListBackupDataRequest
 * @return ListBackupDataResponse
 */
async function listBackupData(request: ListBackupDataRequest): ListBackupDataResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listBackupDataWithOptions(request, headers, runtime);
}

model ListInstancesRequest {
  cmsInstanceType?: string(name='cmsInstanceType', example='standard'),
  resourceGroupId?: string(name='resourceGroupId', description='The ID of the resource group.', example='rg-acfmvscak73zmby'),
  tag?: [ 
    {
      key?: string(name='key', description='The tag key.', example='mytag'),
      value?: string(name='value', description='The tag value.', example='value'),
    }
  ](name='tag', description='The tags to add to the resource.'),
}

model ListInstancesResponseBody = {
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned if the request failed.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  instanceList?: [ 
    {
      commodityCode?: string(name='CommodityCode', description='The commodity code, which is the same as that on the Billing Management page.', example='hologram_postpay_public_cn'),
      creationTime?: string(name='CreationTime', description='The time when the cluster was created.', example='2022-12-16T02:24:05Z'),
      enableHiveAccess?: string(name='EnableHiveAccess', description='Indicates whether lakehouse acceleration is enabled.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
      endpoints?: [ 
        {
          enabled?: boolean(name='Enabled', description='Indicates whether the endpoint is enabled.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
          endpoint?: string(name='Endpoint', description='The endpoint.', example='hgpostcn-cn-aaab9ad2d8fb-cn-hangzhou-internal.hologres.aliyuncs.com:80'),
          type?: string(name='Type', description='The network type.

Valid values:

*   VPCSingleTunnel

    <!-- -->

    :

    <!-- -->

    virtual private cloud (VPC)

    <!-- -->

    .

*   Intranet

    <!-- -->

    :

    <!-- -->

    internal network

    <!-- -->

*   VPCAnyTunnel

    <!-- -->

    : This value is not supported by new instances

    <!-- -->

    <!-- -->

    .

*   Internet

    <!-- -->

    :

    <!-- -->

    Internet

    <!-- -->

    .', example='Internet'),
          vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-wz9oap28raidjevhuszg4'),
          vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-uf6mrahzyu7uorlqqpz5f'),
          vpcInstanceId?: string(name='VpcInstanceId', description='The ID of the VPC to which the instance belongs.', example='hgpostcn-cn-wwo3665tx004-frontend-st'),
        }
      ](name='Endpoints', description='The list of endpoints.'),
      expirationTime?: string(name='ExpirationTime', description='The time when the cluster expires.', example='2023-05-04T16:00:00.000Z'),
      instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the instance. Valid values:

Valid values:

*   PostPaid

    <!-- -->

    :

    <!-- -->

    pay-as-you-go

    <!-- -->

    .

*   PrePaid

    <!-- -->

    :

    <!-- -->

    subscription

    <!-- -->

    .', example='PrePaid'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='hgpostcn-cn-aaab9ad2d8fb'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='test_instance'),
      instanceStatus?: string(name='InstanceStatus', description='The status of the instance.

Valid values:

*   Creating

    <!-- -->

    <!-- -->

    <!-- -->

*   Running

    <!-- -->

    <!-- -->

    <!-- -->

*   Suspended

    <!-- -->

    <!-- -->

    <!-- -->

*   Allocating

    <!-- -->

    <!-- -->

    <!-- -->', example='Running'),
      instanceType?: string(name='InstanceType', description='The type of the instance.

Valid values:

*   Follower

    <!-- -->

    :

    <!-- -->

    read-only secondary instance

    <!-- -->

    .

*   Standard

    <!-- -->

    :

    <!-- -->

    normal instance

    <!-- -->

    .', example='Standard'),
      leaderInstanceId?: string(name='LeaderInstanceId', description='The ID of the primary instance.', example='hgprecn-cn-2r42sqvxm006'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmvscak73zmby'),
      storageType?: string(name='StorageType'),
      suspendReason?: string(name='SuspendReason', description='The reason for the suspension.', example='Manual'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='tag'),
          value?: string(name='Value', description='The tag value.', example='value'),
        }
      ](name='Tags', description='The tags that are added to the resource.'),
      version?: string(name='Version', description='The version of the cluster.', example='1.3.37'),
      zoneId?: string(name='ZoneId', example='cn-hangzhou-h'),
    }
  ](name='InstanceList', description='The instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D1303CD4-AA70-5998-8025-F55B22C50840'),
  success?: string(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ListInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancesResponseBody(name='body'),
}

/**
 * @summary Queries a list of instances.
 *
 * @param request ListInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancesResponse
 */
async function listInstancesWithOptions(request: ListInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstancesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cmsInstanceType)) {
    body['cmsInstanceType'] = request.cmsInstanceType;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['resourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tag)) {
    body['tag'] = request.tag;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListInstances',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of instances.
 *
 * @param request ListInstancesRequest
 * @return ListInstancesResponse
 */
async function listInstances(request: ListInstancesRequest): ListInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listInstancesWithOptions(request, headers, runtime);
}

model ListWarehousesResponseBody = {
  warehouseList?: [ 
    {
      cpu?: long(name='Cpu', description='The number of CPU cores.', example='32'),
      id?: long(name='Id', description='The ID.', example='3'),
      mem?: long(name='Mem', description='The memory capacity.', example='128'),
      name?: string(name='Name', description='The name of the virtual warehouse instance.', example='MyWarehouse'),
      nodeCount?: long(name='NodeCount', description='The number of compute nodes.', example='2'),
      status?: string(name='Status', description='The status.

Valid values:

*   kRunning

    <!-- -->

    <!-- -->

    <!-- -->

*   kSuspended

    <!-- -->

    <!-- -->

    <!-- -->

*   kInit

    <!-- -->

    <!-- -->

    <!-- -->

*   kFailed

    <!-- -->

    <!-- -->

    <!-- -->

*   kAllocating

    <!-- -->

    <!-- -->

    <!-- -->', example='kRunning'),
    }
  ](name='WarehouseList', description='The list of virtual warehouse instances.'),
  requestId?: string(name='requestId', description='The request ID.', example='819A7F0F-2951-540F-BD94-6A41ECF0281F'),
}

model ListWarehousesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWarehousesResponseBody(name='body'),
}

/**
 * @summary Queries the list of virtual warehouse instances.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWarehousesResponse
 */
async function listWarehousesWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListWarehousesResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListWarehouses',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/listWarehouses`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the list of virtual warehouse instances.
 *
 * @return ListWarehousesResponse
 */
async function listWarehouses(instanceId: string): ListWarehousesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWarehousesWithOptions(instanceId, headers, runtime);
}

model RebalanceHoloWarehouseRequest {
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='test_oss'),
}

model RebalanceHoloWarehouseResponseBody = {
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='C0EA5844-AB00-5653-8711-CD9FD1798412'),
}

model RebalanceHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RebalanceHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Triggers shard rebalancing for a virtual warehouse.
 *
 * @param request RebalanceHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RebalanceHoloWarehouseResponse
 */
async function rebalanceHoloWarehouseWithOptions(instanceId: string, request: RebalanceHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RebalanceHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RebalanceHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/rebalanceHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Triggers shard rebalancing for a virtual warehouse.
 *
 * @param request RebalanceHoloWarehouseRequest
 * @return RebalanceHoloWarehouseResponse
 */
async function rebalanceHoloWarehouse(instanceId: string, request: RebalanceHoloWarehouseRequest): RebalanceHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return rebalanceHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model RenameHoloWarehouseRequest {
  name?: string(name='name', description='The original name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
  newWarehouseName?: string(name='newWarehouseName', description='The new name of the virtual warehouse.

This parameter is required.', example='new_name'),
}

model RenameHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model RenameHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenameHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Renames a virtual warehouse.
 *
 * @param request RenameHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenameHoloWarehouseResponse
 */
async function renameHoloWarehouseWithOptions(instanceId: string, request: RenameHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RenameHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.newWarehouseName)) {
    body['newWarehouseName'] = request.newWarehouseName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RenameHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/renameHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Renames a virtual warehouse.
 *
 * @param request RenameHoloWarehouseRequest
 * @return RenameHoloWarehouseResponse
 */
async function renameHoloWarehouse(instanceId: string, request: RenameHoloWarehouseRequest): RenameHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return renameHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model RenewInstanceRequest {
  autoRenew?: boolean(name='autoRenew', description='Specifies whether to enable monthly auto-renewal. The default value is false. Valid values:

*   true
*   false

>  If you enable auto-renewal for an instance for which auto-renewal is enabled, an error is reported.', example='true'),
  duration?: int32(name='duration', description='The renewal duration. Unit: month.

This parameter is required.', example='2'),
}

model RenewInstanceResponseBody = {
  data?: {
    code?: string(name='Code', description='The error code returned.', example='InvalidChargeType.UnRenewable'),
    message?: string(name='Message', description='The error details.', example='InvalidChargeType.UnRenewable'),
    orderId?: string(name='OrderId', description='The ID of the order.', example='221625608580893'),
    success?: boolean(name='Success', description='Indicates whether the renewal was successful.

*   true
*   false', example='true'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code returned.', example='null'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='null'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D3AE84AB-0873-5FC7-A4C4-8CF869D2FA70'),
  success?: string(name='Success', description='The request result, which indicates whether the request was successful.', example='false'),
}

model RenewInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewInstanceResponseBody(name='body'),
}

/**
 * @summary Manually renews a Hologres instance. You can enable monthly auto-renewal when you renew a Hologres instance.
 *
 * @description >  Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing of Hologres, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview).
 * *   For more information about how to renew a Hologres instance, see [Manage renewals](https://www.alibabacloud.com/help/zh/hologres/product-overview/manage-renewals?spm=a2c63.p38356.0.0.38e731c9VAwtDP).
 * *   You can renew only subscription instances.
 *
 * @param request RenewInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewInstanceResponse
 */
async function renewInstanceWithOptions(instanceId: string, request: RenewInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RenewInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.autoRenew)) {
    body['autoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.duration)) {
    body['duration'] = request.duration;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RenewInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/renew`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Manually renews a Hologres instance. You can enable monthly auto-renewal when you renew a Hologres instance.
 *
 * @description >  Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing of Hologres, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview).
 * *   For more information about how to renew a Hologres instance, see [Manage renewals](https://www.alibabacloud.com/help/zh/hologres/product-overview/manage-renewals?spm=a2c63.p38356.0.0.38e731c9VAwtDP).
 * *   You can renew only subscription instances.
 *
 * @param request RenewInstanceRequest
 * @return RenewInstanceResponse
 */
async function renewInstance(instanceId: string, request: RenewInstanceRequest): RenewInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return renewInstanceWithOptions(instanceId, request, headers, runtime);
}

model RestartHoloWarehouseRequest {
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model RestartHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model RestartHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Restarts a virtual warehouse.
 *
 * @param request RestartHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartHoloWarehouseResponse
 */
async function restartHoloWarehouseWithOptions(instanceId: string, request: RestartHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RestartHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RestartHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/restartHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts a virtual warehouse.
 *
 * @param request RestartHoloWarehouseRequest
 * @return RestartHoloWarehouseResponse
 */
async function restartHoloWarehouse(instanceId: string, request: RestartHoloWarehouseRequest): RestartHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return restartHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model RestartInstanceResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the operation was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='36291497-CDB0-53DC-8CD7-762E054F57A6'),
  success?: boolean(name='Success', description='The request result, which indicates whether the request was successful.', example='true'),
}

model RestartInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartInstanceResponseBody(name='body'),
}

/**
 * @summary Restarts an instance.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartInstanceResponse
 */
async function restartInstanceWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): RestartInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'RestartInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/restart`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts an instance.
 *
 * @return RestartInstanceResponse
 */
async function restartInstance(instanceId: string): RestartInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return restartInstanceWithOptions(instanceId, headers, runtime);
}

model ResumeHoloWarehouseRequest {
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model ResumeHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model ResumeHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Resumes a virtual warehouse.
 *
 * @param request ResumeHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeHoloWarehouseResponse
 */
async function resumeHoloWarehouseWithOptions(instanceId: string, request: ResumeHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ResumeHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResumeHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/resumeHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resumes a virtual warehouse.
 *
 * @param request ResumeHoloWarehouseRequest
 * @return ResumeHoloWarehouseResponse
 */
async function resumeHoloWarehouse(instanceId: string, request: ResumeHoloWarehouseRequest): ResumeHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return resumeHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model ResumeInstanceResponseBody = {
  data?: boolean(name='Data', description='The returned result, which indicates whether the operation was successful.', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='D3AE84AB-0873-5FC7-A4C4-8CF869D2FA70'),
  success?: boolean(name='Success', description='The request result, which indicates whether the request was successful.', example='true'),
}

model ResumeInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeInstanceResponseBody(name='body'),
}

/**
 * @summary Resumes an instance.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeInstanceResponse
 */
async function resumeInstanceWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ResumeInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ResumeInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/resume`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resumes an instance.
 *
 * @return ResumeInstanceResponse
 */
async function resumeInstance(instanceId: string): ResumeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return resumeInstanceWithOptions(instanceId, headers, runtime);
}

model ScaleHoloWarehouseRequest {
  cpu?: long(name='cpu', description='The specifications of the virtual warehouse. The number of vCPUs must be an integer multiple of 16.

This parameter is required.', example='64'),
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model ScaleHoloWarehouseResponseBody = {
  data?: boolean(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model ScaleHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ScaleHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Scales in or out a virtual warehouse.
 *
 * @param request ScaleHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ScaleHoloWarehouseResponse
 */
async function scaleHoloWarehouseWithOptions(instanceId: string, request: ScaleHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ScaleHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpu)) {
    body['cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ScaleHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/scaleHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Scales in or out a virtual warehouse.
 *
 * @param request ScaleHoloWarehouseRequest
 * @return ScaleHoloWarehouseResponse
 */
async function scaleHoloWarehouse(instanceId: string, request: ScaleHoloWarehouseRequest): ScaleHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return scaleHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model ScaleInstanceRequest {
  coldStorageSize?: long(name='coldStorageSize', description='The infrequent access (IA) storage space of the instance. Unit: GB.

> Ignore this parameter for pay-as-you-go instances.', example='1000G'),
  cpu?: long(name='cpu', description='The specifications of the instance. Valid values:

*   8-core 32GB (number of compute nodes: 1)
*   16-core 64GB (number of compute nodes: 1)
*   32-core 128GB (number of compute nodes: 2)
*   64-core 256GB (number of compute nodes: 4)
*   96-core 384GB (number of compute nodes: 6)
*   128-core 512GB (number of compute nodes: 8)
*   Others

> 

*   Set this parameter to the number of cores.

*   If you want to set this parameter to specifications with more than 1,024 compute units (CUs), you must submit a ticket.

*   This parameter is invalid for Hologres Shared Cluster instances.

*   The specifications of 8-core 32GB (number of compute nodes: 1) are for trial use only and cannot be used for production.', example='128'),
  enableServerlessComputing?: boolean(name='enableServerlessComputing', description='是否开启ServerlessComputing', example='true'),
  gatewayCount?: long(name='gatewayCount', description='The number of gateways. Valid values: 2 to 50.

> This parameter is required only for virtual warehouse instances.', example='4'),
  scaleType?: string(name='scaleType', description='The specification change type. Valid values:

*   UPGRADE
*   DOWNGRADE

> 

*   If you set this parameter to UPGRADE, the new specifications must be higher than the original specifications. You must configure at least one of the cpu, storageSize, and coldStorageSize parameters. If you leave a parameter empty, the related configuration remains unchanged.

*   If you set this parameter to DOWNGRADE, the new specifications must be lower than the original specifications. You must configure at least one of the cpu, storageSize, and coldStorageSize parameters. If you leave a parameter empty, the related configuration remains unchanged.

This parameter is required.', example='UPGRADE'),
  storageSize?: long(name='storageSize', description='The standard storage space of the instance. Unit: GB.

> Ignore this parameter for pay-as-you-go instances.', example='1000G'),
}

model ScaleInstanceResponseBody = {
  data?: {
    code?: string(name='Code', description='The error code returned.', example='InvalidScaleType.Unsupported'),
    message?: string(name='Message', description='The error details.', example='null'),
    orderId?: string(name='OrderId', description='The ID of the order.', example='219183853450000'),
    success?: boolean(name='Success', description='Indicates whether the change to specifications was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code returned.', example='null'),
  errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='null'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D3AE84AB-0873-5FC7-A4C4-8CF869D2FA70'),
}

model ScaleInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ScaleInstanceResponseBody(name='body'),
}

/**
 * @summary Changes the specifications and storage space of a Hologres instance.
 *
 * @description > Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing of Hologres, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview).
 * *   During the change of computing resource specifications of a Hologres instance, the instance is unavailable. During the change of storage resource specifications of a Hologres instance, the instance can work normally. Do not frequently change instance specifications. For more information, see [Upgrade or downgrade instance specifications](https://www.alibabacloud.com/help/en/hologres/product-overview/upgrade-or-downgrade-instance-specifications).
 *
 * @param request ScaleInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ScaleInstanceResponse
 */
async function scaleInstanceWithOptions(instanceId: string, request: ScaleInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ScaleInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.coldStorageSize)) {
    body['coldStorageSize'] = request.coldStorageSize;
  }
  if (!Util.isUnset(request.cpu)) {
    body['cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.enableServerlessComputing)) {
    body['enableServerlessComputing'] = request.enableServerlessComputing;
  }
  if (!Util.isUnset(request.gatewayCount)) {
    body['gatewayCount'] = request.gatewayCount;
  }
  if (!Util.isUnset(request.scaleType)) {
    body['scaleType'] = request.scaleType;
  }
  if (!Util.isUnset(request.storageSize)) {
    body['storageSize'] = request.storageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ScaleInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/scale`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the specifications and storage space of a Hologres instance.
 *
 * @description > Before you call this operation, make sure that you understand the billing method and pricing of Hologres because this operation is charged.
 * *   For more information about the billing of Hologres, see [Billing overview](https://www.alibabacloud.com/help/zh/hologres/product-overview/billing-overview).
 * *   During the change of computing resource specifications of a Hologres instance, the instance is unavailable. During the change of storage resource specifications of a Hologres instance, the instance can work normally. Do not frequently change instance specifications. For more information, see [Upgrade or downgrade instance specifications](https://www.alibabacloud.com/help/en/hologres/product-overview/upgrade-or-downgrade-instance-specifications).
 *
 * @param request ScaleInstanceRequest
 * @return ScaleInstanceResponse
 */
async function scaleInstance(instanceId: string, request: ScaleInstanceRequest): ScaleInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return scaleInstanceWithOptions(instanceId, request, headers, runtime);
}

model StopInstanceResponseBody = {
  data?: boolean(name='Data', description='The returned result, which indicates whether the operation was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
  success?: boolean(name='Success', description='The request result, which indicates whether the request was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
}

model StopInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopInstanceResponseBody(name='body'),
}

/**
 * @summary Stops an instance.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopInstanceResponse
 */
async function stopInstanceWithOptions(instanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopInstance',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Stops an instance.
 *
 * @return StopInstanceResponse
 */
async function stopInstance(instanceId: string): StopInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopInstanceWithOptions(instanceId, headers, runtime);
}

model SuspendHoloWarehouseRequest {
  name?: string(name='name', description='The name of the virtual warehouse.

This parameter is required.', example='my_warehouse'),
}

model SuspendHoloWarehouseResponseBody = {
  data?: string(name='Data', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
  requestId?: string(name='RequestId', description='Id of the request', example='2A8DEF6E-067E-5DB0-BAE1-2894266E6C6A'),
}

model SuspendHoloWarehouseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SuspendHoloWarehouseResponseBody(name='body'),
}

/**
 * @summary Suspends a virtual warehouse.
 *
 * @param request SuspendHoloWarehouseRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SuspendHoloWarehouseResponse
 */
async function suspendHoloWarehouseWithOptions(instanceId: string, request: SuspendHoloWarehouseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SuspendHoloWarehouseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SuspendHoloWarehouse',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/suspendHoloWarehouse`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Suspends a virtual warehouse.
 *
 * @param request SuspendHoloWarehouseRequest
 * @return SuspendHoloWarehouseResponse
 */
async function suspendHoloWarehouse(instanceId: string, request: SuspendHoloWarehouseRequest): SuspendHoloWarehouseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return suspendHoloWarehouseWithOptions(instanceId, request, headers, runtime);
}

model UpdateInstanceNameRequest {
  instanceName?: string(name='instanceName', description='The new name of the instance. The name must be 2 to 64 characters in length.', example='new_name'),
}

model UpdateInstanceNameResponseBody = {
  data?: boolean(name='Data', description='The returned result, which indicates whether the operation was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='C6B55032-D41A-5FE0-9C07-8BD81C88422E'),
  success?: boolean(name='Success', description='The request result, which indicates whether the request was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
}

model UpdateInstanceNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceNameResponseBody(name='body'),
}

/**
 * @summary Changes the name of an instance.
 *
 * @param request UpdateInstanceNameRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceNameResponse
 */
async function updateInstanceNameWithOptions(instanceId: string, request: UpdateInstanceNameRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateInstanceNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceName)) {
    body['instanceName'] = request.instanceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceName',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/instanceName`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the name of an instance.
 *
 * @param request UpdateInstanceNameRequest
 * @return UpdateInstanceNameResponse
 */
async function updateInstanceName(instanceId: string, request: UpdateInstanceNameRequest): UpdateInstanceNameResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateInstanceNameWithOptions(instanceId, request, headers, runtime);
}

model UpdateInstanceNetworkTypeRequest {
  anyTunnelToSingleTunnel?: string(name='anyTunnelToSingleTunnel', description='Specifies whether to change the network type from AnyTunnel to SingleTunnel. This parameter is invalid for new instances. For new instances, this parameter is set to null by default.

Valid values:

*   others/null: The network type is not changed from AnyTunnel to SingleTunnel.
*   true: The network type is changed from AnyTunnel to SingleTunnel.', example='true'),
  networkTypes?: string(name='networkTypes', description='A list of network types that you want to enable. The network types are randomly ordered in the list. For example, the Internet, Intranet, and VPCSingleTunnel network types are enabled. If you want to disable the Internet type, set this parameter to Intranet,VPCSingleTunnel.

Valid values:

*   VPCSingleTunnel: virtual private cloud (VPC).
*   Intranet: internal network.
*   VPCAnyTunnel: compatibility requirements. This value is not supported by new instances.
*   Internet: Internet.', example='Internet,VPCSingleTunnel'),
  vSwitchId?: string(name='vSwitchId', description='The ID of the vSwitch.', example='vsw-2vccsiymtqr9aavew0vo3'),
  vpcId?: string(name='vpcId', description='The ID of the VPC.', example='vpc-t4netc3y5etlondfb5ra7'),
  vpcOwnerId?: string(name='vpcOwnerId', description='The ID of the Alibaba Cloud account to which the VPC belongs.', example='1999365732646672'),
  vpcRegionId?: string(name='vpcRegionId', description='The region in which the VPC resides.', example='cn-hangzhou'),
}

model UpdateInstanceNetworkTypeResponseBody = {
  data?: string(name='Data', description='The returned result, which indicates whether the operation was successful.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.', example='404'),
  errorMessage?: string(name='ErrorMessage', description='The error message.', example='Internal server error.'),
  httpStatusCode?: string(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='9CC37B9F-F4B4-5FF1-939B-AEE78DC70130'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.

Valid values:

*   true
*   false', example='true'),
}

model UpdateInstanceNetworkTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceNetworkTypeResponseBody(name='body'),
}

/**
 * @summary Modifies the network configuration of an instance.
 *
 * @param request UpdateInstanceNetworkTypeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceNetworkTypeResponse
 */
async function updateInstanceNetworkTypeWithOptions(instanceId: string, request: UpdateInstanceNetworkTypeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateInstanceNetworkTypeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.anyTunnelToSingleTunnel)) {
    body['anyTunnelToSingleTunnel'] = request.anyTunnelToSingleTunnel;
  }
  if (!Util.isUnset(request.networkTypes)) {
    body['networkTypes'] = request.networkTypes;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    body['vSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['vpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.vpcOwnerId)) {
    body['vpcOwnerId'] = request.vpcOwnerId;
  }
  if (!Util.isUnset(request.vpcRegionId)) {
    body['vpcRegionId'] = request.vpcRegionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceNetworkType',
    version = '2022-06-01',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(instanceId)}/network`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the network configuration of an instance.
 *
 * @param request UpdateInstanceNetworkTypeRequest
 * @return UpdateInstanceNetworkTypeResponse
 */
async function updateInstanceNetworkType(instanceId: string, request: UpdateInstanceNetworkTypeRequest): UpdateInstanceNetworkTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateInstanceNetworkTypeWithOptions(instanceId, request, headers, runtime);
}

